<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	template="/layout/templateMini.xhtml">

	<ui:define name="body">
      <a:loadScript src="/script/jquery_balloon.js"/>
      <a:loadScript src="/script/jquery_002.js"/>
	  <script language="JavaScript">
      		$(function() {
				$(".balao td").each(function() {$(this).balloon({ contents: $(this).attr('title'), position: "top", showDuration: "slow",
					  showAnimation: function(d) { this.fadeIn(d); }});});
			});
	    </script>
		<script type="text/javascript">
			$(document).ready(function() {
				$(".various33").fancybox({
					'width'				: 290,
					'height'			: 403,
					'padding'			: 1,
					'autoScale'			: true,
					'transitionIn'		: 'elastic',
					'transitionOut'		: 'elastic',
					'type'				: 'iframe'
				});
			
			});
	    </script>
		
		<div id="page-wrap">
			<h:form id="consulta">
				<div id="resultado" class="name_wrap2" align="left"
					style="color: white; width : 831px;" >
					<rich:panel id="pesquisa"
						style="background: #003984; border:none; color:white; width : 830px;">
<!--	********************************************************************************************************************************************    -->		 
					<!--	TABELA PRINCIPAL	-->
						<h:messages id="messages" style="text-align:left;color:#EF5252; font-weight: bold;" globalOnly="true" styleClass="message"
			            		errorClass="errormsg" infoClass="infomsg" warnClass="warnmsg"
			            		rendered="#{showGlobalMessages != 'false'}"/>
						<rich:dataTable
							onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
							onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
							cellpadding="0" cellspacing="0" width="700px" border="0"
							var="record" value="">
							 <f:facet name="header">
		                        <rich:columnGroup>
		                            <rich:column colspan="3">
		                                <h:outputText value="Meus parceiros" />
		                            </rich:column>
		                            <rich:column breakBefore="true" width="590px" colspan="2">
		                                <h:outputText  value="Nome"  />
		                            </rich:column>
		                            <rich:column>
		                                <h:outputText value="Ações" rendered="#{!corretor.bloquearCampoCreci}"/>
		                            </rich:column>
		                        </rich:columnGroup>
		                    </f:facet>
<!--	********************************************************************************************************************************************    -->		                    
							<!--		TABELA DE DIRETORES      -->
		                    <rich:subTable rendered="#{consultaEquipeAction.renderizaTabDiretor()}"
								onRowMouseOver="this.style.backgroundColor='#F8F8F8'"
								onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
								var="diretores" value="#{consultaEquipeAction.buscaDiretor()}" rowClasses="balao" >
								<rich:column title="&lt;b&gt;ID: #{diretores.codigo}&lt;/b&gt; &lt;br&gt; &lt;b&gt;Telefone: #{diretores.celular1} &lt;/b&gt; &lt;br&gt; &lt;b&gt;Telefone: #{diretores.celular2} &lt;/b&gt;">
									<h:outputText value="#{diretores.nome}"></h:outputText>
							</rich:column>
								
							</rich:subTable>
							<!--		TABELA DE EMP MASTER		-->
							<rich:subTable rendered="#{consultaEquipeAction.renderizaTabEmpMaster()}"
								onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
							    onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
								var="diretores" value="#{consultaEquipeAction.buscaEmpMaster()}" rowClasses="balao">
								<rich:column title="&lt;b&gt;ID: #{diretores.codigo}&lt;/b&gt; &lt;br&gt; &lt;b&gt;Telefone: #{diretores.celular1} &lt;/b&gt; &lt;br&gt; &lt;b&gt;Telefone: #{diretores.celular2} &lt;/b&gt;">
									<h:outputText value="#{diretores.nome}"></h:outputText>
								</rich:column>
								
							</rich:subTable>
							<!--		TABELA CORRETORES		-->
							<rich:subTable rendered="#{consultaEquipeAction.renderizaTabCorretor()}"
								onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
								onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
								var="corretoresEqp" value="#{consultaEquipeAction.buscaCorretor()}" rowClasses="balao" >
								<rich:column style="background-color: #{corretoresEqp.irregular};" width="20px">
									<img title="#{corretoresEqp.qualificacao}" src="../../../../img/cor_#{corretoresEqp.qualificacao}.png" alt="" height="25px" width="20px"  />
									
								</rich:column>
								<rich:column style="background-color: #{corretoresEqp.irregular};" title="&lt;b&gt;ID: #{corretoresEqp.codigo}&lt;/b&gt; &lt;br&gt; &lt;b&gt;Creci: #{corretoresEqp.creci} &lt;/b&gt; &lt;br&gt; &lt;b&gt;Telefone: #{corretoresEqp.celular1} &lt;/b&gt; &lt;br&gt; &lt;b&gt;Telefone: #{corretoresEqp.celular2} &lt;/b&gt;">
									<h:outputText value="#{corretoresEqp.nome}"></h:outputText>
								</rich:column>
								<rich:column style="background-color: #{corretoresEqp.irregular};">
									<h:commandButton title="Descredenciar Corretor" style="" image="../../../../img/usuario.png" action="#{acoesEquipe.comunicarDescredenciamento(corretoresEqp)}" onclick="return confirm('Realmente deseja descredenciar o(a) corretor(a) #{corretoresEqp.nome}?')"  value="Descredenciar" rendered="#{!corretor.bloquearCampoCreci}" />
									<h:commandButton title="Erro no Cadastro" style="margin-left: 6px;" image="../../../../img/editar.png" action="#{acoesEquipe.comunicarErroCadastral(corretoresEqp)}" onclick="return confirm('Realmente deseja informar erros no cadastro do(a) corretor(a) #{corretoresEqp.nome}?')" value="Erro no Cadastro" rendered="#{!corretor.bloquearCampoCreci}"/>
									<s:link styleClass="various33" title="Gerar Rateio" action="#{gerarRelatorioAction.rateioIndividual()}"  view="/paginas/negocio/rateio/consultarRateio/consultarRateioMini.xhtml">
										<h:graphicImage value="../../../../img/rateio.png" />
										<f:param name="CreciCorretor" value="#{corretoresEqp.creci}"/> 
									</s:link>									
								</rich:column>
								
								
								
							</rich:subTable>
							
						</rich:dataTable>
<!--	********************************************************************************************************************************************    -->		 
						<rich:dataTable
							onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
							onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
							cellpadding="0" cellspacing="0" width="700px" border="0"
							var="record" value="" style=" width : 807px;">
							 <f:facet name="header">
		                        <rich:columnGroup>	                        
		                          <rich:column breakBefore="true">
		                                <h:outputText value="Meus parceiros patrocinados" />
		                            </rich:column>
		                           		                        
		                        </rich:columnGroup>
		                    </f:facet>
							
<!--	********************************************************************************************************************************************    -->		 							<!--			TABELA DOS PATROCINADOS				-->
							
							<rich:subTable rendered="#{consultaEquipeAction.renderizaTabCorretor()}"
								onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
								onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
								var="corretores" value="#{consultaEquipeAction.buscaPatrocinado()}" rowClasses="balao">
								<rich:column title="&lt;b&gt;ID: #{corretores.codigo}&lt;/b&gt; &lt;br&gt; &lt;b&gt;Telefone: #{corretores.celular1} &lt;/b&gt; &lt;br&gt; &lt;b&gt;Telefone: #{corretores.celular2} &lt;/b&gt;">
									<h:outputText value="#{corretores.nome}"></h:outputText>
								</rich:column>
								
						    </rich:subTable>
						</rich:dataTable>
					</rich:panel>
				</div>
		 <a:status id="indicator">  
        	<f:facet name="start">                                          
                                              
        	</f:facet>                                          
    	</a:status>  
			</h:form>
				
		</div>
	</ui:define>
</ui:composition>